import { DicesUtil } from "../common/dice/DicesUtil";
import { LoaderManager } from "../../../../com/gengine/resource/LoaderManager";
import { SWFInfo } from "../../../../com/gengine/resource/info/SWFInfo";
import { DiceBarSkin } from "../LGXB/dice/DiceBarSkin";
import { HumanHand } from "../LGXB/dice/HumanHand";
import { IDiceBar } from "../common/dice/interfaces/IDiceBar";
import { IDiceHand } from "../common/dice/interfaces/IDiceHand";
type int = number;
//class FXGZDiceUtil
    
    export  class FXGZDiceUtil extends DicesUtil
    {
        constructor()
        {
            super();
            this._rondomPoints = [new Object /* flash.geom.Point */(245, 321), new Object /* flash.geom.Point */(512, 239), new Object /* flash.geom.Point */(288, 277), new Object /* flash.geom.Point */(292, 219), new Object /* flash.geom.Point */(407, 270), new Object /* flash.geom.Point */(349, 296), new Object /* flash.geom.Point */(228, 224), new Object /* flash.geom.Point */(452, 321), new Object /* flash.geom.Point */(452, 234), new Object /* flash.geom.Point */(355, 234), new Object /* flash.geom.Point */(305, 339), new Object /* flash.geom.Point */(504, 296), new Object /* flash.geom.Point */(395, 335), new Object /* flash.geom.Point */(208, 276)];
            LoaderManager.instance.load("FXGZDice.swf", this.onLoadedHandler);
            return;
        }

        /* internal  */onLoadedHandler(arg1: SWFInfo): void
        {
            var loc1=arg1.getAssetClass("dice2");
            var loc2=arg1.getAssetClass("loading2");
            var loc3=arg1.getAssetClass("hand2");
            var loc4=arg1.getAssetClass("DiceBg2");
            var loc5=arg1.getAssetClass("areaSprite2");
            var loc6=new DiceBarSkin(new loc2());
            var loc7=new HumanHand(new loc3());
            var loc8=new loc5();
            var loc9=null;
            var loc10=new loc4();
            this.initView(loc1, 6, loc6, loc7, loc8, loc10, loc9);
            return;
        }

        public /* override */ initView(arg1: Class, arg2: int, arg3: IDiceBar=null, arg4: IDiceHand=null, arg5: Object /* flash.display.DisplayObject */=null, arg6: Object /* flash.display.DisplayObject */=null, arg7: Object /* flash.display.DisplayObject */=null): void
        {
            arg5.x = 364;
            arg5.y = 251;
            arg3.x = 300;
            arg3.y = 45;
            super.initView(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
            return;
        }

        protected /* override */ getDiceDropDownFromY(arg1: int): number
        {
            return 200 - (power + 20) * 4;
        }

        protected /* override */ getRondomPoints(): Array<any>
        {
            var loc1=0;
            this._tempPoints = [];
            var loc2=this._rondomPoints.concat();
            var loc3=0;
            while (loc3 < _diceNum) 
            {
                loc1 = Math.floor(Math.random() * (loc2.length - 1));
                this._tempPoints.push(loc2[loc1]);
                loc2.splice(loc1, 1);
                ++loc3;
            }
            return this._tempPoints;
        }

        /* internal */ /* var */_rondomPoints: Array<any>;

        /* internal */ /* var */_tempPoints: Array<any>;
    }
